﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;

using Dao;

namespace Service
{
    public class UserService : IUserService
    {
        public IUserDao UserDao { get; set; }

        public IAccountDao AccountDao { get; set; }

        public void SaveData(string name, int age, string accountName)
        {
            UserDao.Create(name, age);
            AccountDao.Create(accountName, name);
            //throw new Exception("测试数据是否回滚");
        }

        public void DeleteData(string name)
        {
            UserDao.Delete(name);
            AccountDao.Delete(name);
            //throw new Exception("测试数据是否回滚");
        }

        public DataSet Get(string name)
        {
            return UserDao.Get(name);
        }
    }
}
